package hadoop.ch03.v17024520116;
import java.net.URI;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;

import javax.sql.rowset.serial.SQLOutputImpl;

public class DownloadHDFSFile {
    public static void main(String[] args) throws Exception {
        Configuration conf = new Configuration();
        URI uri = new URI("hdfs://192.168.30.130:8020");
        FileSystem fs = FileSystem.get(uri, conf, "hadoop");
        Path src = new Path("/17024520116/test5.txt");
        Path dst = new Path("D:\\test5.txt");
        fs.copyToLocalFile(false, src, dst, true);
        fs.close();
        System.out.println("Download Successfully!");
    }
}